package org.gwt.pluginframework.common.event;

import org.gwt.pluginframework.common.IPlugin;

/**
 * Event dispatcher interface.
 * 
 * @author mszymanski
 */
public interface IEventDispatcher {
	/**
	 * Dispatch event to every interested. 
	 * 
	 * @param event
	 */
	void dispatch(IPluginEvent event);
	
	/**
	 * Method allows plug-ins to register event handler.
	 * 
	 * @param plugin
	 * @param handler
	 */
	void registerEventHandler(IPlugin plugin, IPluginEventHandler handler);
	
	/**
	 * Method allows plug-ins to register event handlers.
	 * 
	 * @param plugin
	 * @param handlers
	 */
	void registerEventHandler(IPlugin plugin, IPluginEventHandler[] handlers);
}
